utility
Class pmUtility

java.lang.Object
  extended by utility.pmUtility

public class pmUtility
extends java.lang.Object

A collection of static utility methods for dealing with Jama.Matrix objects.


Constructor Summary
pmUtility()
           
 
Method Summary
static double mean(Jama.Matrix x, int columnToSort)
          Returns the mean of a given column in a matrix.
static double meanAbsoluteDeviations(Jama.Matrix x, int column, double compareTo)
          Returns the mean absolute deviations of a column of a matrix against a number.
static double median(Jama.Matrix x, int columnToSort)
          Returns the median of a given column in a matrix.
static double medianAbsoluteDeviations(Jama.Matrix x, int column, double compareTo)
          Returns the median absolute deviation of a column of a matrix against a number.
static double percentile(Jama.Matrix x, int columnToSort, double alpha)
          Compute percentile of matrix column.
static void prettyPrint(Jama.Matrix x)
          Pretty print Matrix
static void prettyPrintVector(Jama.Matrix x)
          Pretty print vector.
static double standardDeviation(Jama.Matrix x, int col)
          Returns the standard deviation of a given column in a matrix.
static java.lang.String stringPrettyPrint(Jama.Matrix x)
          Pretty print Matrix.
static java.lang.String stringPrettyPrintVector(Jama.Matrix x)
          Pretty text format of a vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

pmUtility

public pmUtility()
Method Detail

meanAbsoluteDeviations

public static double meanAbsoluteDeviations(Jama.Matrix x,
                                            int column,
                                            double compareTo)
Returns the mean absolute deviations of a column of a matrix against a number.

Parameters:
x - Matrix of data.
column - Index of column to be used in calculation.
compareTo - Value to compute absolute deviations against.
Returns:
Mean absolute deviation.

medianAbsoluteDeviations

public static double medianAbsoluteDeviations(Jama.Matrix x,
                                              int column,
                                              double compareTo)
Returns the median absolute deviation of a column of a matrix against a number.

Parameters:
x - Matrix of data.
column - Index of column to be used in calculation.
compareTo - Value to compute absolute deviation against.
Returns:
Median absolute deviation.

stringPrettyPrintVector

public static java.lang.String stringPrettyPrintVector(Jama.Matrix x)
Pretty text format of a vector.

Parameters:
x - Jama.Matrix to be formatted.
Returns:
String representation.

stringPrettyPrint

public static java.lang.String stringPrettyPrint(Jama.Matrix x)
Pretty print Matrix.

Parameters:
x - Matrix to be printed.
Returns:
String representation of Matrix.

prettyPrint

public static void prettyPrint(Jama.Matrix x)
Pretty print Matrix

Parameters:
x - Matrix to pretty print.

percentile

public static double percentile(Jama.Matrix x,
                                int columnToSort,
                                double alpha)
Compute percentile of matrix column.

Parameters:
x - Matrix of data.
columnToSort - Column to compute.
alpha - Percentile to compute.
Returns:
Percentile of Matrix column.

prettyPrintVector

public static void prettyPrintVector(Jama.Matrix x)
Pretty print vector.

Parameters:
x - Vector to pretty print.

mean

public static double mean(Jama.Matrix x,
                          int columnToSort)
Returns the mean of a given column in a matrix.

Parameters:
x - Matrix of data.
columnToSort - Index of column to be used in the calcuation.
Returns:
Mean of indicated column from passed matrix.

median

public static double median(Jama.Matrix x,
                            int columnToSort)
Returns the median of a given column in a matrix.

Parameters:
x - Matrix of data.
columnToSort - Index of column to be used in the calculation.
Returns:
Median of indicated column from passed matrix.

standardDeviation

public static double standardDeviation(Jama.Matrix x,
                                       int col)
Returns the standard deviation of a given column in a matrix.

Parameters:
x - Matrix of data.
col - Index of column to be used in the calculation.
Returns:
The standard deviation of a given column in the matrix.